% ' Start ASP code here before the HTML. Its always better to do as much ASP stuff before any output. ' First of all, include a simple file which contains some variable values. %> <% ' Now some values have been set we can use them to connect to the Access database ' First, build a SQL query to get the data we want. ' in order to get the specific file, we use the primary key ID which is passed in ' the URL querystring variable "id" sql = "Select * from tblPlaces where placeID = " & request.querystring("id") ' Now create a record set to hold the data. "conString" is the connection string and is a variable which has it's ' value set in the include "vars.htm" file on line . ' Line 20 opens the recordset which I've imaginatively called "rsContent". rs being Record Set obviously ;} set rsContent = Server.CreateObject("ADODB.Recordset") rsContent.ActiveConnection = conString rsContent.Source = sql rsContent.CursorType = 3 rsContent.CursorLocation = 2 rsContent.LockType = 1 rsContent.Open() ' OK, now assign some values to some variables which we will later output to the screen ' We only want the text of the place and also the HTML to print. placeName = (rsContent.Fields.Item("placeText").Value) placesList = (rsContent.Fields.Item("placeHTML").Value) ' That's it. We have no more use for this record set object so tidy up rsContent.Close() Set rsContent = Nothing ' Now we have the data from we need stored in variables, its time to output stuff ' First, get the basic HTML stuff out of the way %>